#pragma once

#include "NotifyIcon.hpp"

class HelperWindowCreationException
{
public:
	HelperWindowCreationException(const SimpleString &error) : m_error(error) { }

	const SimpleString &get_Message() { return m_error; }
	__declspec(property(get = get_Message)) const SimpleString &Message;

private:
	SimpleString m_error;
};

class CHelperWindow
{
public:
	static CHelperWindow& GetInstance(HINSTANCE hInstance, HWND hWnd)
	{
		static CHelperWindow helperWindow(hInstance, hWnd);
		return helperWindow;
	}
		
	void CreateNotifyIcon()
	{
		CNotifyIcon::GetInstance().CreateNotifyIcon(m_hInstance, m_hwnd);
	}
	
	~CHelperWindow();

private:
	CHelperWindow(HINSTANCE, HWND);
	CHelperWindow(CHelperWindow const&);
	void operator=(CHelperWindow const&);

	static LRESULT CALLBACK RelayWndProc(HWND, UINT, WPARAM, LPARAM);
	LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

	HINSTANCE	m_hInstance;
	HWND		m_hwnd, m_hMainWnd;
	UINT		m_wmTaskbarCreated;
};
